package com.ruoyi.project.lesson.uploadtask.domain;

import com.ruoyi.common.utils.SizeUtil;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.util.Date;

/**
 * 上传任务对象 upload_task
 *
 * @author shixiangwen
 * @date 2020-12-11
 */
public class UploadTask extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 文件路径
     */
    @Excel(name = "文件路径")
    private String filepath;

    /**
     * 大小
     */
    @Excel(name = "大小")
    private Long size;

    private String sizeFormat;

    /**
     * 文件md5
     */
    @Excel(name = "文件md5")
    private String md5;

    /**
     * 文件名
     */
    @Excel(name = "文件名")
    private String name;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private Integer status;

    /**
     * 结果
     */
    @Excel(name = "结果")
    private Long result;

    /**
     * 类型
     */
    @Excel(name = "类型")
    private String type;

    /**
     * 结束时间
     */
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date finishTime;

    /**
     * 音视频ID
     */
    @Excel(name = "音视频ID")
    private String vodId;

    /**
     * 是否自动转码
     */
    @Excel(name = "是否自动转码")
    private Integer autoTranscode;

    private Integer transcodeStatus;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }

    public String getFilepath() {
        return filepath;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getSize() {
        return size;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getMd5() {
        return md5;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setResult(Long result) {
        this.result = result;
    }

    public Long getResult() {
        return result;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setVodId(String vodId) {
        this.vodId = vodId;
    }

    public String getVodId() {
        return vodId;
    }

    public void setAutoTranscode(Integer autoTranscode) {
        this.autoTranscode = autoTranscode;
    }

    public Integer getAutoTranscode() {
        return autoTranscode;
    }

    public String getSizeFormat() {
        return SizeUtil.sizeFormat(size);
    }

    public void setSizeFormat(String sizeFormat) {
        this.sizeFormat = sizeFormat;
    }

    public Integer getTranscodeStatus() {
        return transcodeStatus;
    }

    public void setTranscodeStatus(Integer transcodeStatus) {
        this.transcodeStatus = transcodeStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("filepath", getFilepath())
                .append("size", getSize())
                .append("md5", getMd5())
                .append("name", getName())
                .append("createdTime", getCreatedTime())
                .append("status", getStatus())
                .append("result", getResult())
                .append("type", getType())
                .append("finishTime", getFinishTime())
                .append("vodId", getVodId())
                .append("autoTranscode", getAutoTranscode())
                .toString();
    }
}
